package com.zeta.demo.kt.model.entity

import com.baomidou.mybatisplus.annotation.TableField
import com.baomidou.mybatisplus.annotation.TableLogic
import com.baomidou.mybatisplus.annotation.TableName
import com.fasterxml.jackson.annotation.JsonIgnore
import io.swagger.v3.oas.annotations.media.Schema
import jakarta.validation.constraints.NotBlank
import jakarta.validation.constraints.Size
import org.zetaframework.base.entity.Entity

/**
 * Kotlin测试
 *
 * @author gcc
 */
@Schema(description = "Kotlin测试")
@TableName(value = "demo_kotlin")
class DemoKotlin : Entity<Long>() {

    /** 名称 */
    @Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @get:NotBlank(message = "名称不能为空")
    @get:Size(max = 32, message = "名称长度不能超过32")
    @TableField(value = "name")
    var name: String? = null

    /** 编码 */
    @Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED)
    @get:NotBlank(message = "编码不能为空")
    @get:Size(max = 32, message = "编码长度不能超过32")
    @TableField(value = "code")
    var code: String? = null

    /** 描述 */
    @Schema(description = "描述", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
    @TableField(value = "describe_")
    var describe: String? = null

    /** 逻辑删除字段  */
    @JsonIgnore
    @Schema(description = "逻辑删除字段", requiredMode = Schema.RequiredMode.REQUIRED)
    @TableLogic
    private var deleted: Boolean? = null

}